<include file="__THEME__/common/header" />
<script language="javascript">
$(function(){
	$('#datagrid').datagrid({
		toolbar:[{
			id:'btnadd',
			text:'新增应用',
			iconCls:'icon-add',
			handler:function(){
				toUrl('{:U("Apps/add")}');
			}
		},'-',
		{
			text:'编辑应用',
			iconCls:'icon-edit',
			handler:function(){
				var row = $('#datagrid').datagrid('getSelected');
				if (row){
					toUrl("{:U('Apps/edit')}&app_id="+row.app_id);
				}
			}
		},'-',{
			text:'删除应用',
			iconCls:'icon-remove',
			handler:function(){
				var row = $('#datagrid').datagrid('getSelected');
				if (row){
					$.messager.confirm('提示', '确定删除吗？', function(r){
					if (r){
						ajaxPost("{:U('Apps/remove')}", {'app_id': row.app_id}, function(d){
							if(d.status == 0){
								alertText(d.info, 'error');
							}else{
								$('#datagrid').datagrid('reload');
							}
						});
					}else return false;
					});	
				}
			}
		}]
	});
});
function d(v, r){
	return 'fdsf';
}
</script>
<div class="box">
<table id="datagrid" width="100%" title="应用列表" url="{:U('system://Apps/lst')}" pagination="true" singleSelect="true" idField="app_id">
	<thead>
        <tr>
            <th field="app_id" width="50" sortable="true" checkbox="true">ID</th>
            <th field="app_name" width="100" sortable="true">应用名称</th>
            <th field="app_title" width="150" sortable="true" align="left">应用标题</th>
            <th field="add_time" width="100" sortable="true" align="left">添加时间</th>
            <th field="sort" width="50" sortable="true">排序</th>
            <th field="remark" width="150">备注</th>
        </tr>
    </thead>
</table>
</div>
<include file="__THEME__/common/footer" />